package com.hzncc.scaffold.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzncc.scaffold.entity.Other.Industrynews;
import com.hzncc.scaffold.entity.Vo.IndustryNewsVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 行业新闻表 Mapper 接口
 * </p>
 *
 * @author DrunkBear
 * @since 2022-04-27
 */
public interface IndustrynewsMapper extends BaseMapper<Industrynews> {


    @Select("SELECT\n" +
            "\t`id`,\n" +
            "\t`title`,\n" +
            "\t`info`,\n" +
            "\t`content`,\n" +
            "\t`status`,\n" +
            "\t`pubTime`,\n" +
            "\t`stayAtTop` \n" +
            "FROM\n" +
            "\t`industrynews` AS `industrynews` \n" +
            "WHERE\n" +
            "\t`industrynews`.`status` = 1 \n" +
            "ORDER BY\n" +
            "\t`industrynews`.`stayAtTop` DESC,\n" +
            "\t`industrynews`.`sortTime` DESC,\n" +
            "\t`industrynews`.`id` DESC ")
    public List<IndustryNewsVo> list();

}
